package core

import (
	"kuafu/config"
	"kuafu/core/plugin/input"
	"kuafu/core/plugin/output"
)

type LogBeat struct {
}

func (*LogBeat) Start(config *config.AppConfig) {

	//监听文件，拉取数据
	watcher := new(Watcher)
	watcher.Watch(config)

	//构建管道
	pipeLine := new(PipeLine)
	pipeLine.inputs = make([]input.InPlugin, 0)
	pipeLine.inputs = append(pipeLine.inputs, &input.LogParserPlugin{})

	pipeLine.outputs = make([]output.OutPlugin, 0)
	pipeLine.outputs = append(pipeLine.outputs, output.Create(config))
	pipeLine.Start(watcher, config)

}
